<template>
  <div
    class="Chip_CircleArea"
    :style="{
      transform: `rotateZ(${-angle}deg)`,
      ...circleStyle.area,
    }"
  >
    <div
      v-for="it in dt"
      class="circles"
      :class="{ active: it.id === time, visible: it.visible }"
      :key="it.id"
      :style="{
        transform: `rotateZ(${it.angle}deg)`,
        fontSize: it.visible || it.id === time ? fontSize : 0,
        ...circleStyle.s,
      }"
    >
      <div class="label" :style="labelStyle">{{ it.label }}</div>
    </div>
  </div>
</template>
<script>
export default {
  inheritAttrs: false,
  name: "Chip_CircleArea",
  props: {
    dt: {
      type: Array,
      default: () => [],
    },
    fontSize: {
      type: String,
      default: "",
    },
    circleStyle: {
      type: Object,
      default: () => {},
    },
    time: {
      type: Number,
      default: 0,
    },
    angle: {
      type: Number,
      default: 0,
    },
  },
  computed: {
    labelStyle() {
      let fontSize = this.fontSize
      return {
        width: fontSize,
        height: fontSize,
      }
    },
  },
}
</script>
<style lang="scss" scoped>
.Chip_CircleArea {
  position: absolute;
  transition: $trans5;
  z-index: 3;
  border-radius: 50%;
  border: 1px $dark1 dashed;
  // box-shadow: $dark1 0 0 $dis10;
}
.circles {
  position: absolute;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transform-origin: 50% 100%;
  transition: $trans5;
  color: $dark5;
  padding-top: $dis10;
  .label {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
  }
  &::before {
    content: "";
    width: 4px;
    height: 4px;
    top: $dis5;
    position: absolute;
    background-color: $dark3;
    border-radius: 2px;
  }
  &.visible {
    &::before {
      display: none;
    }
  }
  &.active {
    color: $blue;
    .label {
      z-index: 2;
      text-shadow: $blue 0 0 2px,#fff 0 0 2px, #fff 0 0 1px, #fff 0 0 1px;
    }
    &::before {
      background-color: $blue;
    }
  }
}
</style>
